home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ MSI Options 7.xpl < prev    next >
Text File  |  2004-03-01  |  4KB  |  136 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="3"
  4. "UIPATH 1"="System\Software Installation\Company/Owner Information"
  5. "UIPATH 2"="Virtual Paranoia\User Data"
  6. "NAME"="Software Company/Owner Information"
  7. "LANGUAGE"="VBScript"
  8. "OSVERSION"="00010111"
  9. "VERSION"="1.01"
  10. "TEXT 1"="Show Info"
  11. "TEXT 2"="Edit Company"
  12. "TEXT 3"="Edit Ower/User"
  13. "DESCRIPTION 1"="Each program that is installed by the Windows Installer (MSI) can have a registered company and a registered owner associated with it."
  14. "DESCRIPTION 2"="Some programs use this registered company and owner by displaying it inside the "About" box of the program. An example of this procedure is Office XP and upwards."
  15. "DESCRIPTION 3"="This list shows you all installed programs on your computer that have been installed by MSI. Beside the name of it, it displays you the registered company and owner. Use the buttons to change the company, the owner or both to whatever you wish. "
  16. "DESCRIPTION 4"="If some products do not have a company or owner, this is not a failure. Some programs simply do not make any use of this information."
  17. "AUTHOR"="Xteq Systems"
  18. "CONTACTURL"="http://www.xteq.com"
  19. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  20. "COMMENT 1"="NT AUTHORITY\SYSTEM        S-1-5-18"
  21. "COMMENT 2"=" "
  22.  
  23.  
  24. sP="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\"
  25.    sDisp="\InstallProperties\DisplayName"
  26. sCompany="\InstallProperties\RegCompany"
  27.    sUser="\InstallProperties\RegOwner"
  28.  
  29. sTMP_DisplayName=""
  30. sTMP_Company=""
  31. sTMP_User=""
  32.  
  33.  
  34. Dim aryLoc()
  35.  
  36. 'Called when the Plugin is started
  37. SUB Plugin_Initialize
  38.  iCount=RegEnumPaths(sP)
  39.  
  40.  'count how many real items we have
  41.  
  42.  if iCount>0 then
  43.     'redim array
  44.     ReDim aryLoc(iCount)
  45.  
  46.     for l=1 to iCount
  47.         aryLoc(l)=RegEnumElement(l)
  48.         Call GetAllInfos(aryLoc(l))
  49.  
  50.         if len(sTMP_DisplayName)>0 then 
  51.            sInfo=""
  52.            if len(sTMP_Company)=0 and len(sTMP_User)=0 then
  53.               sInfo="NONE"
  54.            else
  55.               sInfo=sTMP_Company & "/" & sTMP_User
  56.            end if
  57.            sInfo="(" & sInfo & ")"
  58.            Call SetUIElement(l,sTMP_DisplayName & " " & sInfo)
  59.         end if
  60.     next
  61.  else
  62.     Disable
  63.  end if
  64. END SUB
  65.  
  66. Sub GetAllInfos(ItemGUID)
  67.  'reset values
  68.  sTMP_DisplayName=""
  69.  sTMP_Company=""
  70.  sTMP_User=""
  71.  
  72.  sTMPRegPath=sP & ItemGUID & sDisp
  73.  sTMP_DisplayName=RegReadValue(sTMPRegPath)
  74.  
  75.  sTMPRegPath=sP & ItemGUID & sCompany
  76.  sTMP_Company=RegReadValue(sTMPRegPath)
  77.  
  78.  sTMPRegPath=sP & ItemGUID & sUser
  79.  sTMP_User=RegReadValue(sTMPRegPath)
  80. end Sub
  81.  
  82.  
  83.  
  84. 'Called when the Plugin should validate the Data the user has entered
  85. SUB Plugin_CheckData(ElementIndex)
  86. END SUB
  87.  
  88. 'Called when the Plugin should apply the changes
  89. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  90.  if ElementSubIndex>0 then 'OK, user has selected an item
  91.     sItem=aryLoc(ElementSubIndex) 
  92.     Call GetAllInfos(sItem)      
  93.  
  94.    If ElementIndex=1 then 'show info 
  95.       sInfo1="Product: " & sTMP_DisplayName & chr(13) & chr(10)
  96.       sInfo2="Registered Company: " &  sTMP_Company & chr(13) & chr(10)
  97.       sInfo3="Registered User: " &  sTMP_User & chr(13) & chr(10)  
  98.  
  99.       Call MsgInformation(sInfo1 & sInfo2 & sInfo3) 
  100.    end if
  101.  
  102.    
  103.    If ElementIndex=2 then 'edit company
  104.        sRegPath=sP & sItem & sCompany
  105.        sV=sTMP_Company
  106.        sV=InputWindow("Please type the company for the selected product",sV,1)
  107.  
  108.        if IsEmpty(sV)=false then
  109.           'change it!
  110.           Call RegWriteValue(sRegPath,sV,1)          
  111.           Call Plugin_Initialize
  112.        end if 
  113.    end if
  114.  
  115.    If ElementIndex=3 then 'edit user
  116.        sRegPath=sP & sItem & sUser
  117.        sV=sTMP_User
  118.        sV=InputWindow("Please type the owner for the selected product",sV,1)
  119.  
  120.        if IsEmpty(sV)=false then
  121.           'change it!
  122.           Call RegWriteValue(sRegPath,sV,1)          
  123.           Call Plugin_Initialize
  124.        end if 
  125.    end if
  126.  
  127.  
  128.  else
  129.   Call MsgWarning("No item selected - please select an item first.")
  130.  end if
  131. END SUB
  132.  
  133. 'Called when the Plugin is about to be removed from memory
  134. SUB Plugin_Terminate
  135. END SUB
  136.